<template>
  <div class="order_cont">
    <van-tabs  v-model="active"  @click="onClick">
      <van-tab v-for="(item,index) in tabData" :title="item.title" :key="index">
        内容 {{ index }}
      </van-tab>
    </van-tabs>
  </div>
</template>
<script>
export default {
  created () {
    //   console.log(this.$route.query.name)
      if(this.$route.query.name==="all"){
          this.active=0;
      }else if(this.$route.query.name==="dfk"){
          this.active=1;
      }else if(this.$route.query.name==="dfh"){
          this.active=2;
      }else if(this.$route.query.name==="dsh"){
          this.active=3;
      }else if(this.$route.query.name==="dpj"){
          this.active=4;
      }else if(this.$route.query.name==="tk"){
          this.active=5;
      }
  },
  data() {
    return {
      active: '',
      tabData: [
        {
          "id": 1,
          "title": "全部",
          "content": "sss"
        }, {
          "id": 2,
          "title": "待付款",
          "content": "sss"
        }, {
          "id": 3,
          "title": "待发货",
          "content": "sss"
        }, {
          "id": 4,
          "title": "待收货",
          "content": "sss"
        }, {
          "id": 5,
          "title": "待评价",
          "content": "sss"
        }, {
          "id": 6,
          "title": "退款",
          "content": "sss"
        }
      ]
    }
  },
  methods: {
      onClick(index, title){
          this.$toast(title);
      }
  }
}
</script>
<style lang="scss" scoped>
.order_cont {
  padding: 10px 0px;
}
</style>
